Skip to content

Improve quorum queue Ra system configurability (backport #15962)#15997

Merged
michaelklishin merged 2 commits intov4.3.xfrom
mergify/bp/v4.3.x/pr-15962
Apr 10, 2026
Merged

Improve quorum queue Ra system configurability (backport #15962)#15997
michaelklishin merged 2 commits intov4.3.xfrom
mergify/bp/v4.3.x/pr-15962

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented Apr 10, 2026

Summary

Make all quorum queue Ra configuration parameters explicit and configurable via rabbitmq.conf.

This PR expands on the initial work to make segment sizing configurable by exposing all quorum queue Ra system parameters through the quorum_queue.* configuration namespace. This allows operators to fine-tune Raft log and WAL behavior specifically for quorum queues, with backward compatibility for the legacy raft.* configuration options.

Motivation

Previously, quorum queue Ra system parameters could only be configured via the global raft.* settings or the pre-launch default configuration. This PR provides dedicated quorum_queue.* configuration options that:

  1. Make the configuration flow explicit and discoverable
  2. Allow quorum queue-specific tuning without affecting other Ra-based systems (Khepri, streams)
  3. Maintain backward compatibility with existing raft.* configurations
  4. Centralize defaults in one place for easier maintenance

Changes

New quorum_queue.* Configuration Options

  • quorum_queue.segment_max_size_bytes (default: 64 MB)
  • quorum_queue.segment_max_entries (default: 4096)
  • quorum_queue.wal_max_size_bytes (default: 512 MB)
  • quorum_queue.wal_max_entries (default: 500,000)
  • quorum_queue.wal_max_batch_size (default: 4096)
  • quorum_queue.wal_compute_checksums (default: true)
  • quorum_queue.segment_compute_checksums (default: true)
  • quorum_queue.max_append_entries_rpc_batch_size (default: 16)
  • quorum_queue.compress_mem_tables (default: true)
  • quorum_queue.snapshot_chunk_size (default: 1 MB)

Implementation Details

  1. Schema Mappings: Added Cuttlefish schema mappings for each quorum_queue.* setting that map to rabbit application environment variables
  2. Backward Compatibility: Each quorum_queue.* setting falls back to the corresponding raft.* setting if not explicitly configured
  3. Explicit Configuration: All parameters are explicitly passed to the quorum_queues Ra system configuration during initialization, making the data flow transparent
  4. Defaults Alignment: All default values match the RabbitMQ prelaunch defaults, ensuring consistent behavior
  5. Code Simplification: Simplified WalMaxEntries handling to use application:get_env with macro defaults instead of complex case statement logic

Files Changed

  • deps/rabbit/src/rabbit_ra_systems.erl: Updated to read quorum_queue configuration and apply defaults via macros
  • deps/rabbit/priv/schema/rabbit.schema: Added mappings and translations for all quorum_queue.* settings
  • deps/rabbit/docs/rabbitmq.conf.example: Documented all new configuration options
  • deps/rabbit/test/config_schema_SUITE_data/rabbit.snippets: Added test coverage for all new settings

Test Plan

  • Configuration schema tests verify all mappings parse correctly
  • Default values align with Ra's built-in defaults
  • Backward compatibility verified via fallback to raft.* settings
  • Build compiles successfully without linter errors

Notes

  • All defaults match the values previously set in rabbit_prelaunch_conf.erl
  • Configuration is centralized via macros for easier future maintenance
  • No breaking changes; existing configurations continue to work unchanged
    This is an automatic backport of pull request Improve quorum queue Ra system configurability #15962 done by Mergify.

Add support for configuring Ra's segment_max_size_bytes parameter via
rabbitmq.conf as raft.segment_max_size_bytes. This allows operators to
control the maximum size of Raft log segment files for quorum queues.
The configuration:
- Maps quorum_queue.segment_max_size_bytes in rabbitmq.conf to
  rabbit.quorum_segment_max_size_bytes in the application environment
- Defaults to Ra's built-in default of 64 MB when not configured
- Is explicitly applied to the quorum_queues Ra system configuration
  for transparency and maintainability
Also add a macro QUORUM_DEFAULT_SEGMENT_MAX_SIZE_B to align with Ra's
default value.

(cherry picked from commit eacdd0c)
…urable

Add support for configuring all quorum queue Ra system parameters via
rabbitmq.conf using the quorum_queue.* namespace. This allows operators to
fine-tune Raft log and WAL behavior specifically for quorum queues.

New quorum_queue.* configuration options:
- quorum_queue.wal_compute_checksums (default: true)
- quorum_queue.segment_compute_checksums (default: true)
- quorum_queue.max_append_entries_rpc_batch_size (default: 16)
- quorum_queue.compress_mem_tables (default: true)
- quorum_queue.segment_max_size_bytes (default: 64 MB)
- quorum_queue.segment_max_entries (default: 4096)
- quorum_queue.wal_max_size_bytes (default: 512 MB)
- quorum_queue.wal_max_entries (default: 500,000)
- quorum_queue.wal_max_batch_size (default: 4096)
- quorum_queue.snapshot_chunk_size (default: 1 MB)

Each quorum_queue.* setting has a fallback to the corresponding raft.*
setting for backward compatibility with existing configurations.

All configuration is mapped to rabbit application environment variables
and explicitly applied to the quorum_queues Ra system during initialization,
making the data flow transparent and maintainable.

Add macros for all default values that match the RabbitMQ prelaunch defaults,
centralizing configuration defaults in one place for easier maintenance.

Simplify WalMaxEntries handling to use application:get_env with macro
default instead of complex case statement checking DefaultConfig.

(cherry picked from commit 42927f0)
@michaelklishin michaelklishin disabled auto-merge April 10, 2026 03:14
@michaelklishin michaelklishin merged commit dd4bc26 into v4.3.x Apr 10, 2026
181 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.3.x/pr-15962 branch April 10, 2026 03:14
@michaelklishin michaelklishin added this to the 4.3.0 milestone Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants